package cn.uestc.labhms.modules.hms.entity.Vo;

import cn.uestc.labhms.modules.hms.param.ValidateConst;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * @author Mu.tz
 */
@Data
public class AddFieldVo {
    @NotBlank(message = "中文表名不能为空")
    private String tableNameC;
    private String tableNameE;
    @Pattern(regexp = ValidateConst.FIELD_REGEX, message = ValidateConst.FIELD_ERROR_MSG)
    @Length(min = 2, max = 32, message = "英文字段名请使用2到32个字符长度")
    private String fieldE;
    @Length(min = 1, max = 32, message = "中文字段名请使用1到32个字符长度")
    @NotBlank(message = "fieldC不可以为空")
    @Pattern(regexp = ValidateConst.FIELDC_REGEX, message = ValidateConst.FIELDC_ERROR_MSG)
    private String fieldC;
    @Max(value = 65535, message = "字段容量最大值为65535")
    @Min(value = 1, message = "字段容量最小值为1")
    @NotNull(message = "字段长度不可以为空")
    private Integer fieldLen;
}
